package com.ycfmedical.bed.bean;

import java.io.Serializable;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 用户账户信息 Created by Egoist on 2017/1/4.
 */

public class ImUser implements Serializable, Parcelable
{
    private static final long serialVersionUID = -8791912318742847895L;
    
    public Long id;
    
    // IM账号
    public String imAccount;
    
    // IM SIGN
    public String imSign;
    
    public ImUser()
    {
    }
    
    private static ImUser ImInstance = new ImUser();
    
    public static ImUser getInstance()
    {
        return ImInstance;// 此单例仅用于IM登录！
    }
    
    @Override
    public void writeToParcel(Parcel dest, int flags)
    {
        dest.writeString(imAccount);
        dest.writeString(imSign);
    }
    
    @Override
    public int describeContents()
    {
        return 0;
    }
    
    public static final Creator<ImUser> CREATOR = new Creator<ImUser>()
    {
        @Override
        public ImUser createFromParcel(Parcel in)
        {
            return new ImUser(in);
        }
        
        @Override
        public ImUser[] newArray(int size)
        {
            return new ImUser[size];
        }
    };
    
    protected ImUser(Parcel in)
    {
        imAccount = in.readString();
        imSign = in.readString();
    }
    
    public Long getId()
    {
        return id;
    }
    
    public void setId(Long id)
    {
        this.id = id;
    }
    
    public String getImAccount()
    {
        return imAccount;
    }
    
    public void setImAccount(String imAccount)
    {
        this.imAccount = imAccount;
    }
    
    public String getImSign()
    {
        return imSign;
    }
    
    public void setImSign(String imSign)
    {
        this.imSign = imSign;
    }
    
    @Override
    public String toString()
    {
        return "ImUser{" + "id=" + id + ", imAccount='" + imAccount + '\'' + ", imSign='" + imSign + '\'' + '}';
    }
}
